package kaumono.action;

import java.util.logging.Logger;

import susano.presen.controller.Action;
import susano.presen.controller.Navigation;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserServiceFactory;

/**
 * index action.
 *
 * @author tanaka.akira.2006
 * @version $Id: IndexAction.java 687 2009-11-13 07:55:17Z tanaka.akira.2006 $
 *
 */
public class IndexAction extends Action {

	protected static final Logger log = Logger.getLogger(IndexAction.class
			.getName());

	@Override
	protected Navigation init() {
		setParams();
		return forward("index.jsp");
	}

	@Override
	protected Navigation execute() {
		setParams();
		return forward("index.jsp");
	}

	@Override
	protected Navigation validate() {
		return null;
	}

	private void setParams() {
		requestScope("pubFlg", 1);
		requestScope("nickName", "にっくねーむ");
		User user = UserServiceFactory.getUserService().getCurrentUser();
		if (user != null)
			requestScope("user", user.getEmail());
	}
}
